package com.jhx.common.model

import android.annotation.SuppressLint
import com.jhx.common.thirdparty.db.AppDataBase
import com.raizlabs.android.dbflow.annotation.Column
import com.raizlabs.android.dbflow.annotation.PrimaryKey
import com.raizlabs.android.dbflow.annotation.Table
import com.raizlabs.android.dbflow.structure.BaseModel
import java.io.Serializable

/**
 * 视频
 * @author Jack 2018-03-07 17:39
 *
 * @param comment_num 评论数
 * @param praise_num  点赞数
 * @param context     内容
 * @param play_num    点击量
 * @param share_video_num 转发量
 */
@SuppressLint("ParcelCreator")
@Table(database = AppDataBase::class)
class Video : BaseModel(),Serializable {

    @PrimaryKey
    var id: String? = ""

    @Column
    var video_url: String? = ""

    @Column
    var create_time: Long? = 0L

    @Column
    var cover_url: String? = ""

    @Column
    var comment_num: String? = ""

    @Column
    var praise_num: String? = ""

    @Column
    var context: String? = ""

    @Column
    var play_num: String? = ""

    @Column
    var share_video_num: String? = ""

    /**
     * 当前视频的播放状态
     */
    var playStatus: Int = PlayState.STATE_STOP
    @Column
    var user_id: String? = ""
    /**
     * 视频长度
     */
    @Column
    var countTime: String = ""

    var v_title: String? = ""
    /**
     * 当前视频置顶状态
     */
    var is_top = 0

    /**
     * 后台返回的时长
     */
    var video_time_length: String? = ""

    companion object {
        val KEY_ADD_WATERMARK = "add_watermark"
        // 非置顶状态
        val STATUS_NOTTOP = 0

        // 置顶状态
        val STATUS_ISTOP = 1
        // 分辨率
        val VIDEO_RESOLUTION = "video_resolution"
        // 码率
        val VIDEO_RATE = "video_rate"

        val COVER_PATH = "cover_path"

        val CODE_POST_SUCCESS = 0x111
        // 数据库增加
        val CODE_ADD = 0x112
        // 清晰度更新
        val CODE_RESOLUTION = 0X113
        // 数据更新
        val CODE_UPDATE = 0x114
        // 删除视频
        val CODE_DELETE_VIDEO = 0x115
        // 置顶视频
        val CODE_TOP_VIDEO = 0x116
    }

}